import request, { Method, buyerUrl,commonUrl,communityUrl} from '@/plugins/request.js'
// 修改手机号
export function phone(data) {
    return request({
        url: buyerUrl + '/buyer/passport/member/editPhone',
        method: Method.POST,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        needToken: true,
        data
    })
}
// 修改密码
export function setPwd(data) {
    return request({
        url: buyerUrl + '/buyer/passport/member/modifyPass',
        method: Method.PUT,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        needToken: true,
        data
    })
}
// 获取验证码
export function getCode(data) {
    return request({
        url: commonUrl + '/common/common/sms/EDIT_MOBILE/'+data,
        method: Method.GET,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        needToken: true,
        data
    })
}
// 修改用户资料
export function edituser(data) {
    return request({
        url: buyerUrl + '/buyer/passport/member/editOwn',
        method: Method.POST,
        headers: {
            "Content-Type": 'application/json'
        },
        needToken: true,
      data
    })
}
// 修改达人认证
export function updateAuthPeople(data) {
  return request({
      url: communityUrl + '/mobileapi/community/peopleup',
      method: Method.POST,
      headers: {
          "Content-Type": 'application/json'
      },
      needToken: true,
    data
  })
}
// 判断是否已经认证达人认证
export function getAuthPeople(params) {
  return request({
      url: communityUrl + '/mobileapi/community/peopleup',
      method: Method.GET,
      headers: {
          "Content-Type": 'application/json'
      },
      needToken: true,
      params
  })
}
// 获取第三方绑定列表
export function getBindList(params) {
  return request({
      url: buyerUrl + '/buyer/passport/connect/bind/list',
      method: Method.GET,
      headers: {
          "Content-Type": "application/x-www-form-urlencoded"
      },
      needToken: true,
      params
  })
}

// 绑定第三方账号
export function bindAccount(data) {
  return request({
      url: buyerUrl + '/buyer/passport/connect/bind',
      method: Method.POST,
      headers: {
        "Content-Type": "multipart/form-data",
      },
      needToken: true,
      data
  })
}

// 解绑第三方账号
export function unBindAccount(data) {
  return request({
      url: buyerUrl + '/buyer/passport/connect/bind/unbind',
      method: Method.POST,
      headers: {
        "Content-Type": "multipart/form-data",
      },
      needToken: true,
      data
  })
}
